function Dict(dictName) {
    this.url='/common/dictSelect?appFieldName=';
    this.dictData=[];
    this.dictName=dictName;
    //方法
    if(typeof this.dictFormat !="function")
    {
        Dict.prototype.dictFormat=function(value)
        {
            for (var i=0;i<this.dictData.length;i++)
            {
                var item = this.dictData[i];
                if (item.fieldValue == value)
                {
                    return item.valueComment;
                }
            }
        };

        Dict.prototype.select = function(control,value,excludeValues){
            if(!excludeValues){
                excludeValues = [];
            }
            //设置Select2的处理
            control.select2({
                allowClear: false,
                escapeMarkup: function (m) {
                    return m;
                }
            });

            //绑定Ajax的内容
            control.empty();//清空下拉框
            $.each(this.dictData, function (i, item) {
                if( -1 == $.inArray(item.fieldValue, excludeValues)){
                    if(value){
                        if(item.fieldValue == value){
                            control.append($("<option value='" + item.fieldValue + "' selected='selected'> " + item.valueComment + "</option>"));
                        }else{
                            control.append($("<option value='" + item.fieldValue + "'> " + item.valueComment + "</option>"));
                        }
                    }else{
                        control.append($("<option value='" + item.fieldValue + "'> " + item.valueComment + "</option>"));
                    }
                }
            });
        }
    };

    var $this = this;
    var respText = $.ajax({
        url:BASE_PATH+this.url+this.dictName,
        async:false
    }).responseText;
    $this.dictData = $.parseJSON(respText);
    return this;
 }
